$(() => {

    $('.btn1').on('click', function () {
        $('.s2').addClass('dis')
        $('.s3').addClass('dis')
        getAn()
    })
    $('.btn2').on('click', function () {
        $('.s2').toggleClass('dis')
        $('.s3').toggleClass('dis')
    })

    function getAn() {

        $.ajax({
            type: 'get',
            url: 'http://api.tianapi.com/zimi/index',
            data: {
                key: "d528bbe3b7134059960128b221a68c46"
            },
            success: ({ newslist }) => {
                $('.s1').text(newslist[0].content)
                console.log(newslist);
                $('.s2').text(newslist[0].answer)
                $('.s3').text(newslist[0].reason)
            }

        })


    }

})